<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script type="text/javascript">
		var arr = [2,4,6];
		var num = 0;
		arr.forEach((item,index) => {
			num += item;
		});
		console.log(num)
	</script>
</body>
</html>